package com.xiaoshuidi.cloud.module.member.controller.app.enterprise;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.member.controller.app.enterprise.vo.EnterpriseCreateVO;
import com.xiaoshuidi.cloud.module.member.enums.ApiConstants;
import com.xiaoshuidi.cloud.module.member.service.enterprise.MemberEnterpriseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.xiaoshuidi.cloud.framework.common.pojo.CommonResult.success;

@Tag(name = "租客APP - 企业用户")
@RestController
@RequestMapping(ApiConstants.NAME+"/enterprise")
@Validated
public class AppMemberEnterpriseController {
    @Resource
    MemberEnterpriseService memberEnterpriseService;

    @PostMapping("/create")
    @Operation(summary = "创建个人客户")
    public CommonResult<Boolean> create(@RequestBody EnterpriseCreateVO vo) {
        memberEnterpriseService.createEnterprise(vo);
        return success(true);
    }
}
